﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication2
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("введите цифры через \"-\"");
            string testString = Console.ReadLine();
            Console.WriteLine();
            string[] strArr = testString.Split('-');
            Array.Sort(strArr);
            //bool duplicated = false;
            int currentElementReiteration = 0;
            string[,] summaryArray = new string[strArr.Length,2 ];
            for (int counter = 0; counter < strArr.Length; counter++)
            {
                summaryArray[counter, 0] = strArr[counter];
                for (int innerCounter = 0; innerCounter < strArr.Length; innerCounter++)
                    {
                        if (strArr[counter] == strArr[innerCounter])
                        {
                        currentElementReiteration++;
                        summaryArray[counter, 1] = currentElementReiteration.ToString();
                        }                    
                    }
                currentElementReiteration = 0;
            }


            for (int counter = 0; counter < strArr.Length; counter++)
            {
                if (counter == 0)
                {
                    Console.WriteLine("{0}:{1}", summaryArray[counter, 0], summaryArray[counter, 1]);
                }
                else
                {
                    if (summaryArray[counter, 0] != summaryArray[counter - 1, 0])
                        Console.WriteLine("{0}:{1}", summaryArray[counter, 0], summaryArray[counter, 1]);
                }
                
            }
            Console.ReadKey();
        }
    }
}
